]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
weather: Fix warning on closing Weather
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 31 Jul 2019 23:24:13 +0000 (01:24 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 7 Aug 2019 18:53:41 +0000 (18:53 +0000)
GDBusProxy::g-properties-changed is also emitted when the name drops from
the bus, at which point any properties will be null. That's not a valid
gsettings value, so to avoid the corresponding warning, move the g-name-owner
check accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1158

js/misc/weather.js

index 3e1a2ba8661e13b9278b0828049e31664feef22e..f097c76f617f4897fc3b60c1c0d954702fd9a475 100644 (file)
@@ -153,12 +153,13 @@ var WeatherClient = class {
 
         this._weatherProxy.connect('g-properties-changed',
             this._onWeatherPropertiesChanged.bind(this));
-
-        if (this._weatherProxy.g_name_owner != null)
-            this._onWeatherPropertiesChanged();
+        this._onWeatherPropertiesChanged();
     }
 
     _onWeatherPropertiesChanged() {
+        if (this._weatherProxy.g_name_owner == null)
+            return;
+
         this._settings.set_boolean('automatic-location',
             this._weatherProxy.AutomaticLocation);
         this._settings.set_value('locations',